package com.ruibang.glass.purchase.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 采购退货表，用于记录采购退货的相关信息
 * </p>
 *
 * @author mameng
 * @since 2024-03-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "采购退货表")
@TableName("g_purchase_returns")
public class PurchaseReturns extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty(value = "退货单号")
    private String returnOrderNumber;

    @ApiModelProperty(value = "退货类型")
    private String returnType;

    @ApiModelProperty(value = "采购单号")
    private String purchaseOrderNumber;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime creationTime;

    @ApiModelProperty(value = "供应商")
    private String supplierName;

    @ApiModelProperty(value = "供应商Id")
    private String supplierId;

    @ApiModelProperty(value = "退货状态")
    private String returnStatus;

    @ApiModelProperty(value = "退款状态")
    private String refundStatus;

    @ApiModelProperty(value = "订单状态")
    private String orderStatus;

    @ApiModelProperty(value = "申请人")
    private String applyName;

    @ApiModelProperty(value = "申请人Id")
    private String applyId;

    @ApiModelProperty(value = "申请部门名称")
    private String applyDepartmentName;

    @ApiModelProperty(value = "申请部门id")
    private String applyDepartmentId;

    @ApiModelProperty(value = "申请时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime applyTime;

    @ApiModelProperty(value = "验收人")
    private String inspectorName;

    @ApiModelProperty(value = "验收人ID")
    private String inspectorId;

    @ApiModelProperty(value = "备注信息")
    private String remarks;

    @ApiModelProperty(value = "总退款额")
    private BigDecimal returnAllAmount;

    @ApiModelProperty(value = "审批状态")
    private String approveStatus;

    @ApiModelProperty(value = "退换货状态 0_处理中 1_完成")
    private String returnChangeStatus;


    @ApiModelProperty(value = "退货物品详情")
    @TableField(exist = false)
    private List<PurchaseReturnGoods> purchaseReturnGoodsList;


    @ApiModelProperty(value = "文件集合")
    @TableField(exist = false)
    private List<String> fileList;

    @ApiModelProperty(value = "审批节点")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "审批人")
    @TableField(exist = false)
    private String approveUser;

    @ApiModelProperty(value = "审批人Id")
    @TableField(exist = false)
    private String approveUserId;

    @ApiModelProperty(value = "菜单Id")
    @TableField(exist = false)
    private String menuId;

    @ApiModelProperty(value = "流程Id")
    @TableField(exist = false)
    private String processId;


    @ApiModelProperty(value = "退货原因")
    private String returnReason;


    @ApiModelProperty(value = "仓库名称")
    @TableField(exist = false)
    private String warehouseName;

    @ApiModelProperty(value = "仓库Id")
    @TableField(exist = false)
    private String warehouseId;

    @ApiModelProperty(value = "库位名称")
    @TableField(exist = false)
    private String locationName;

    @ApiModelProperty(value = "库位Id")
    @TableField(exist = false)
    private String locationId;

    @ApiModelProperty(value = "条形码")
    @TableField(exist = false)
    private String barcodeNumber;

    @ApiModelProperty(value = "批次号")
    @TableField(exist = false)
    private String pcNumber;


}
